<template>
    
</template>
<script>
export default {
    data(){
        return{
            
        }
    },
    computed:{
        orderNotice(){
            return this.$store.state.main.orderNotice
        },
    },
    watch:{
        orderNotice(obj){
            // console.log('有新的订单',obj)
            if(obj){
                let order = {...obj}
                console.log(order)
                this.$notify({
                    title: '有新的订单',
                    message:`用户${order.user_name}刚刚共下单${order.goods.length}笔订单,配送方式为${order.order_type}`,
                    duration: 0,
                    position: 'bottom-right',
                });
                // order.forEach((item, index)=>{
                //     setTimeout(()=>{

                //     },1000)
                //     this.$notify({
                //         title: '有新的订单',
                //         message:`用户${order.user_name}刚刚下单了${order.goods.length}件商品,配送方式为${order.order_type}`,
                //         position: 'bottom-right',
                //     });
                // }, 1000*index)
            }
        }
    },
}
</script>

<style lang="scss" scoped>

</style>
